//
//  PMDialog.h
//
//  Copyright (C) 2007 Visual.Wei
//  Author: Wei Shuai <cpuwolf@sina.com>
//
//
// This program is free software; you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation; either version 2 of the License.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this program; if not, write to the Free Software
// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA
//
#ifndef __H_PMDIALOG__
#define __H_PMDIALOG__

#include "PMControl.h"
#include "PMHandleControlList.h"
#include "progbar.h"
#include <aygshell.h>

class PMDialog:public PMControl
{
	DLGPROC g_pDialogFunc;
public :
	PMDialog(HWND,LPCTSTR,DLGPROC);
	~PMDialog()
	{
		DestroyWindow(g_hwnd);
	}
	DWORD ReSize();
	virtual DWORD InitDialog(WPARAM wParam, LPARAM lParam)
	{
		return TRUE;
	}
	void Create()
	{
		g_hwnd=CreateDialogParam(g_hInst,m_pTemplate,g_hpwnd,g_pDialogFunc,(LPARAM)this);
		Update();
		ReSize();
		ShowWindow(g_hwnd,SW_SHOW);
	}
protected:
	
	//WinCE support only
	void InitShDialog(HWND hDlg)
	{
		// Create a Done button and size it.  
		SHINITDLGINFO shidi;
		shidi.dwMask = SHIDIM_FLAGS;
		shidi.dwFlags = SHIDIF_FULLSCREENNOMENUBAR;
		shidi.hDlg = hDlg;
		SHInitDialog(&shidi);
	}

private:
	LPCTSTR m_pTemplate;
	static PMDialog * m_pclass;

	static INT_PTR CALLBACK DialogProc(HWND hwndDlg,UINT uMsg,WPARAM wParam,LPARAM lParam);

};


#endif